<?php

class Db_Tables2_BSigner
{
	function __construct() {
		$this->dealers_db = Zend_Registry::get("dealers_db");
	}
	
	function GetSigners()
	{
		$result = array();
		
		$select = $this->dealers_db->select();
		$select->from("b_signer", array("signer_id", "company_name"));
		$select->where("status = ?", 1);
		$select->order("company_name");
		$data = $this->dealers_db->fetchAll($select);
		
		if(!empty($data))
		{
			foreach($data as $d)
			{
				$result[$d['signer_id']] = $d['company_name'];
			}
		}
		
		return $result;
	}
	
	function FetchSignerDetails($signer_id)
	{
		$result = array();
		
		if($signer_id)
		{
			$select = $this->dealers_db->select();
			$select->from("b_signer", "*");
			$select->where("signer_id = ?", $signer_id);
			$result = $this->dealers_db->fetchRow($select);
		}
		
		return $result;
	}
}